package com.atguigu.yygh.hosp.controller.user;

import com.atguigu.yygh.common.result.R;
import com.atguigu.yygh.hosp.service.DepartmentService;
import com.atguigu.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author mgx
 * @version 1.0
 * @description: TODO
 * @date 2022/8/31 15:34
 */
@RestController
@RequestMapping("/user/hosp/department")
@Api(tags = {"前台部门信息管理"})
public class UserDepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @ApiOperation(value = "根据医院编号获取所有科室信息")
    @GetMapping("/all/{hoscode}")
    public R getDepartmentList(@PathVariable("hoscode")String hoscode) {
        List<DepartmentVo> departmentList = departmentService.getDepartmentList(hoscode);
        return R.ok().data("list", departmentList);
    }
}
